package com.project.controller;

import com.project.bean.RootBean;
import com.project.service.IRootService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("root")
public class RootController {
    @Autowired
    private IRootService service;

    @RequestMapping("findAll")
    public List<RootBean> findAll() {
        return service.findAll();
    }

    public List<RootBean> findByUserId(int id) {
        return service.findByUserId(id);
    }
}
